<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class UserRecharge extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        // `user_id` int(11) NOT NULL COMMENT '用户ID',
        //  `no` varchar(255) NOT NULL COMMENT '充值流水号',
        //  `price` decimal(11,2) NOT NULL COMMENT '充值金额',
        //  `pay_name` varchar(255) NOT NULL COMMENT '支付方式名称',
        //  `pay_status` tinyint(1) NOT NULL COMMENT '支付状态，1：未支付，2：支付成功，3：支付超时',
        //  `pay_time` int(11) NOT NULL COMMENT '支付时间',
        Schema::dropIfExists('user_recharge');
        Schema::create('user_recharge', function (Blueprint $table){
            $table->comment = "用户充值";
            $table->increments('id')->comment("ID");

            $table->integer('user_id')->comment("用户ID");
            $table->string("no")->comment("充值流水号");
            $table->decimal('price',10,2)->comment("充值金额");
            $table->string("pay_name")->comment("支付方式名称");
            $table->tinyInteger("pay_status")->comment("支付状态");
            $table->integer("pay_time")->comment("支付时间");

            $table->integer('create_time')->comment("创建时间");
            $table->integer('update_time')->comment("更新时间");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
